<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />

  <script src="https://static.robotwebtools.org/threejs/current/three.js"></script>
  <script src="https://static.robotwebtools.org/threejs/current/ColladaLoader.js"></script>
  <script src="https://static.robotwebtools.org/threejs/current/STLLoader.js"></script>
  <script src="https://static.robotwebtools.org/EventEmitter2/current/eventemitter2.min.js"></script>
  <script src="https://static.robotwebtools.org/roslibjs/current/roslib.js"></script>
<script src="http://static.robotwebtools.org/ros3djs/current/ros3d.min.js"></script>
<script src="../build/jointstatepublisher.js"></script>

<script>
  var topic;
  /**
   * Setup all visualization elements when the page is loaded.
   */
  function init() {
    // Connect to ROS.
    var ros = new ROSLIB.Ros({
      url : 'ws://127.0.0.1:9090'
    });

    // Create the main viewer.
    var viewer = new ROS3D.Viewer({
      divID : 'urdf',
      width : 800,
      height : 600,
      antialias : true
    });

    // Add a grid.
    viewer.addObject(new ROS3D.Grid());

    // Setup a client to listen to TFs.
    var tfClient = new ROSLIB.TFClient({
      ros : ros,
      angularThres : 0.01,
      transThres : 0.01,
      rate : 10.0
    });

    // Setup the URDF client.
    var urdfClient = new ROS3D.UrdfClient({
      ros : ros,
      tfClient : tfClient,
      path : 'http://127.0.0.1:8080/probot_anno',
      rootObject : viewer.scene,
    });


    var jsp = new JOINTSTATEPUBLISHER.JointStatePublisher({
        ros : ros,
        divID : 'sliders'
    });
       


  }
</script>
</head>

<body onload="init()">
  <div id="sliders" style="float: right"></div>
  <div id="urdf"></div>
</body>
</html>
